<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\file\FileInput;
/* @var $this yii\web\View */
/* @var $model common\models\wechat\WechatVideoReply */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="row">
    <div class="col-lg-12">
        <section class="panel">
        <div class="panel-body">
            <div class="adv-table editable-table ">
                <div class="wechat-video-reply-form">
                    <?php $form = ActiveForm::begin([
                        'options' => ['class' => 'form-horizontal','enctype' => 'multipart/form-data'],
                        'fieldConfig' => [
                            'template' => "<div class='col-xs-3 col-sm-2 text-right'>{label}</div><div class='col-xs-9 col-sm-7'>{input}</div><div class='col-xs-12 col-xs-offset-3 col-sm-3 col-sm-offset-0'>{error}</div>",
                        ]
                    ]); ?>
                    <?= $form->field($rule, 'name')->textInput(['maxlength' => true]) ?>

                    <?= $form->field($keyword, 'content')->textInput(['maxlength' => true]) ?>

                    <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

                    <?= $form->field($model, 'description')->textInput(['maxlength' => true]) ?>

                    <?= $form->field($keyword, 'type')->dropDownList([1=>'直接匹配',2=>'包含关键字',3=>'正则']) ?>

                    <?= $form->field($rule, 'status')->dropDownList([1=>'激活',2=>'失效']) ?>

                    <?= $form->field($model, 'file')->widget(FileInput::classname(), [
                        'options' => ['multiple' => false],
                        'pluginOptions' => [
                            // 需要预览的文件格式
                            'previewFileType' => 'image',
                            // 预览的文件
                            'initialPreview' => \common\components\Upload::checkGetUrl($model->getAttribute('file'),false,'file'),
                            // 需要展示的图片设置，比如图片的宽度等
                            'initialPreviewConfig' => ['width' => '120px'],
                            // 是否展示预览图
                            'initialPreviewAsData' => true,
                            'showUpload' => false,
                        ],
                    ]); ?>
                    <div class="form-group">
                        <?= Html::submitButton($model->isNewRecord ? '确认提交' : '确认更新', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
                    </div>
                    <?php ActiveForm::end(); ?>
                </div>
            </div>
        </div>
    </section>
</div>
</div>